<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
      id: <input type="text" v-model="id">
      语言名: <input type="text" v-model="name">
        <input type="button" value="添加" v-on:click="add">
        <ul>
            <li v-for="(item,i) in emps" v-bind:key="item.id"> 
                <input type="checkbox" name="" id="">
                索引值:{{i}}-----序号：{{item.id}}-----语言名：{{item.name}}
            </li>
        </ul>
    </div>
    <script src="vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                id:'',
                name:'',
                emps:[
                    {id:"001",name:'Java'},
                    {id:"002",name:'JavaScript'},
                    {id:"003",name:'PHP'},
                ],
                emp:{id:'004',name:"Go"}
            },
            methods:{
                add:function(){
                    this.emps.unshift({id:this.id,name:this.name})
                    // unshift在数组的头部添加信息，push在尾部添加信息
                }
            }
        })
    </script>
</body>
</html>